package com.hitqz.robot.camera.module;

import com.hitqz.robot.camera.lib.NetSDKLib;

/**
 * 云台控制接口实现
 * 主要有 ：八个方向控制、变倍、变焦、光圈功能
 */
public class PtzControlModule {

	/**
	 * 向上
	 */
	public static boolean ptzControlUpStart(NetSDKLib.LLong userId, int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
									NetSDKLib.NET_PTZ_ControlType.NET_PTZ_UP_CONTROL, 
									lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlUpEnd(NetSDKLib.LLong userId,int nChannelID) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
									 NetSDKLib.NET_PTZ_ControlType.NET_PTZ_UP_CONTROL, 
									 0, 0, 0, 1);
	}
	
	/**
	 * 向下
	 */
	public static boolean ptzControlDownStart(NetSDKLib.LLong userId,int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											NetSDKLib.NET_PTZ_ControlType.NET_PTZ_DOWN_CONTROL, 
											lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlDownEnd(NetSDKLib.LLong userId,int nChannelID) {
		return 	LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											 NetSDKLib.NET_PTZ_ControlType.NET_PTZ_DOWN_CONTROL, 
											 0, 0, 0, 1);
	}
	
	/**
	 * 向左
	 */
	public static boolean ptzControlLeftStart(NetSDKLib.LLong userId,int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											NetSDKLib.NET_PTZ_ControlType.NET_PTZ_LEFT_CONTROL, 
											lParam1, lParam2, 0, 0);	
	}
	public static boolean ptzControlLeftEnd(NetSDKLib.LLong userId,int nChannelID) {
		return	LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											 NetSDKLib.NET_PTZ_ControlType.NET_PTZ_LEFT_CONTROL, 
											 0, 0, 0, 1);	
	}
	
	/**
	 * 向右
	 */
	public static boolean ptzControlRightStart(NetSDKLib.LLong userId,int nChannelID, int lParam1,int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											NetSDKLib.NET_PTZ_ControlType.NET_PTZ_RIGHT_CONTROL, 
											lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlRightEnd(NetSDKLib.LLong userId,int nChannelID) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											 NetSDKLib.NET_PTZ_ControlType.NET_PTZ_RIGHT_CONTROL, 
											 0, 0, 0, 1);		
	}
	
	/**
	 * 向左上
	 */
	public static boolean ptzControlLeftUpStart(NetSDKLib.LLong userId,int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTTOP, 
											lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlLeftUpEnd(NetSDKLib.LLong userId,int nChannelID) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											 NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTTOP, 
											 0, 0, 0, 1);	
	}
	
	/**
	 * 向右上
	 */
	public static boolean ptzControlRightUpStart(NetSDKLib.LLong userId,int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTTOP, 
											lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlRightUpEnd(NetSDKLib.LLong userId,int nChannelID) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
											 NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTTOP, 
											 0, 0, 0, 1);	
	}

	/**
	 * 向左下
	 */
	public static boolean ptzControlLeftDownStart(NetSDKLib.LLong userId,int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
													NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTDOWN, 
													lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlLeftDownEnd(NetSDKLib.LLong userId,int nChannelID) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
										 NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTDOWN, 
										 0, 0, 0, 1);
	}
	
	/**
	 * 向右下
	 */
	public static boolean ptzControlRightDownStart(NetSDKLib.LLong userId,int nChannelID, int lParam1, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
													NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTDOWN, 
													lParam1, lParam2, 0, 0);
	}
	public static boolean ptzControlRightDownEnd(NetSDKLib.LLong userId,int nChannelID) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
										 NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTDOWN, 
										 0, 0, 0, 1);
	}
	
    /**
     * 变倍+
     */
    public static boolean ptzControlZoomAddStart(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
							        	   NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_ADD_CONTROL, 
							        	   0, lParam2, 0, 0);
    }
    public static boolean ptzControlZoomAddEnd(NetSDKLib.LLong userId,int nChannelID) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
					            		    NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_ADD_CONTROL, 
					            		    0, 0, 0, 1);
    }

    /**
     * 变倍-
     */
    public static boolean ptzControlZoomDecStart(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
       return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
							        	    NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_DEC_CONTROL, 
							        	    0, lParam2, 0, 0);
    }
    public static boolean ptzControlZoomDecEnd(NetSDKLib.LLong userId,int nChannelID) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
					            		     NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_DEC_CONTROL, 
					            		     0, 0, 0, 1);
    }

    /**
     * 变焦+
     */
    public static boolean ptzControlFocusAddStart(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
    	return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
									        	    NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_ADD_CONTROL, 
									        	    0, lParam2, 0, 0);
    }
    public static boolean ptzControlFocusAddEnd(NetSDKLib.LLong userId,int nChannelID) {
    	return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
				            		     NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_ADD_CONTROL, 
				            		     0, 0, 0, 1);
    }

    /**
     * 变焦-
     */
    public static boolean ptzControlFocusDecStart(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
							        	    NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_DEC_CONTROL, 
							        	    0, lParam2, 0, 0);
    }
    public static boolean ptzControlFocusDecEnd(NetSDKLib.LLong userId,int nChannelID) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
					            		     NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_DEC_CONTROL, 
					            		     0, 0, 0, 1);
    }

    /**
     * 光圈+
     */
    public static boolean ptzControlIrisAddStart(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
							        	    NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_ADD_CONTROL, 
							        	    0, lParam2, 0, 0);
    }
    public static boolean ptzControlIrisAddEnd(NetSDKLib.LLong userId,int nChannelID) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
					            		     NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_ADD_CONTROL, 
					            		     0, 0, 0, 1);
    }

    /**
     * 光圈-
     */
    public static boolean ptzControlIrisDecStart(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
									        	    NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_DEC_CONTROL, 
									        	    0, lParam2, 0, 0);
    }
    public static boolean ptzControlIrisDecEnd(NetSDKLib.LLong userId,int nChannelID) {
        return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
					            		     NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_DEC_CONTROL, 
					            		     0, 0, 0, 1);
    }


	/**
	 * 预置点   设置、删除、转动
	 */
	public static boolean ptzControlPointSet(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
				NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_SET_CONTROL,
				0, lParam2, 0, 0);
	}

	public static boolean ptzControlPointDel(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
				NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_DEL_CONTROL,
				0, lParam2, 0, 0);
	}

	public static boolean ptzControlPointMove(NetSDKLib.LLong userId,int nChannelID, int lParam2) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
				NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_MOVE_CONTROL,
				0, lParam2, 0, 0);
	}

	public static boolean ptzControlExactGoto(NetSDKLib.LLong userId,int nChannelID, int lParam3) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
				NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_EXACTGOTO,
				0, 0, lParam3, 0);
	}

	public static boolean ptzControlLight(NetSDKLib.LLong userId,int nChannelID, int lParam1,int lParam2,int lParam3) {
		return LoginModule.netsdk.CLIENT_DHPTZControlEx(userId, nChannelID,
				NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LIGHTCONTROL,
				lParam1, lParam2, lParam3, 0);
	}

}
